{% extends 'base/base.html' %}
{% block title %}我的消息{% endblock %}
{% block main %}
  <h4>我的消息</h4>
  {% for msg in msg_list %}
    <div class="card mb-2 {% if msg.unread %}border-primary{% endif %}">
      <div class="card-body">
        <h6 class="card-title">
          <a href="{% url 'messagesite:detail' msg.id %}" class="text-decoration-none">
            {{ msg.title }}
          </a>
          {% if msg.unread %}<span class="badge bg-danger">未读</span>{% endif %}
        </h6>
        <small class="text-muted">来自：{{ msg.sender }} · {{ msg.created|date:"Y-m-d H:i" }}</small>
      </div>
    </div>
  {% empty %}
    <p class="text-muted">暂无消息</p>
  {% endfor %}
{% endblock %}